$(document).ready(function() {
   var email_contact = '[your_email]';
 	if (typeof lang.your_email != 'undefined'){
 		email_contact = lang.your_email;
 	}
 	
 	$("#address_list_email").focus(function(){
 		if ($(this).val() == email_contact){
 			$(this).val('');
 		}
 	});
 	$("#address_list_email").blur(function(){
 		if ($(this).val() == ''){
 			$(this).val(email_contact);
 		}
 	});
 	
 	var your_name = '[your_name]';
 	if (lang.your_name != 'undefined'){
 		your_name = lang.your_name;
 	}
 	
 	$("#address_list_name").focus(function(){
 		if ($(this).val() == your_name){
 			$(this).val('');
 		}
 	});
 	$("#address_list_name").blur(function(){
 		if ($(this).val() == ''){
 			$(this).val(your_name);
 		}
 	});
 	
 	$("#btn-send").click(function(){
 		if (!$("#contact_form").valid()){
 			return false;
 		}
 		 $.ajax({
            url: settings.base_url + 'index.php/' + lang.lang_key + '/address_list/save_address/',
            dataType: 'json',
            type: 'POST',
            data: {
                nume: $('#address_list_name').val(),
                email: $('#address_list_email').val()
            },
            success: function(data){
                $("#info").show();
                $("#info").html(data.message);

            },
            complete: function()
            {
            },
            error: function()
            {
            }
        });
 	});
});